package cn.kgc.controller;


import cn.kgc.dto.MalfunctionDto;
import cn.kgc.dto.Result;
import cn.kgc.service.MalfunctionService;
import cn.kgc.utils.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 评估信息 前端控制器
 * </p>
 *
 * @author psq
 * @since 2021-08-05
 */
@Api("评估信息")
@RestController
@RequestMapping("/api/evaluate")
public class EvaluateController {

    private final MalfunctionService malfunctionService;

    public EvaluateController(MalfunctionService malfunctionService) {
        this.malfunctionService = malfunctionService;
    }

    @ApiOperation("specList")
    @GetMapping("specList")
    public Result<List<MalfunctionDto>> findSpecListByModelId(Long modelId) {
        List<MalfunctionDto> list = malfunctionService.findSpecListByModelId(modelId);
        return ResultUtils.returnDataSuccess(list);
    }
}

